package com.abaaba.project2.controller;

import com.abaaba.project2.bean.bo.ConfigWXBO;
import com.abaaba.project2.bean.vo.BaseRespVo;
import com.abaaba.project2.bean.vo.ConfigeWxVO;
import com.abaaba.project2.service.AdminConfigWXService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Hedgehog
 * @Date 2021/6/6 23:23
 * @Version 1.0
 */
@RestController
@RequestMapping("admin/config")
public class AdminConfigWXController {
   /* @Autowired
    AdminConfigWXService adminConfigWXService;
*/
   @Autowired
   AdminConfigWXService adminConfigWXService;

    @RequestMapping(value = "wx",method = RequestMethod.GET)
    public BaseRespVo wxConfigGet(){
        ConfigeWxVO configeWxVO = adminConfigWXService.selectConfigWX();

       // return BaseRespVo.ok(configeWxVO);
        return BaseRespVo.ok(configeWxVO);
    }

    @RequestMapping(value = "wx",method = RequestMethod.POST)
    public BaseRespVo wxConfigPost(@RequestBody ConfigWXBO configWXBO){
        adminConfigWXService.updateConfigWX(configWXBO);

        // return BaseRespVo.ok(configeWxVO);
        return BaseRespVo.ok();
    }


}
